<!DOCTYPE html>
<html style="height: 100%">
<head>
    <meta charset="UTF-8">
    <!--1.添加视口标签 快捷方式：meta:vp -->
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <!--2.设置网页渲染模式  快捷方式：meta:compat  -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!--3.把bootstrap 核心样式（压缩版）引入-->
    <title>发布统计</title>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.css" rel="stylesheet">
    <link href="http://www.jq22.com/jquery/font-awesome.4.6.0.css" rel="stylesheet">
    <style>
        .form-control:hover {
            cursor: pointer;
        }

        .form-inline {
            position: fixed;
            text-align: center;
            right: 5%;
            z-index: 9;
        }
    </style>

</head>
<body style="height: 100%; margin: 0">

<form class="form-inline" method="post">{% csrf_token %}
    <div class="form-group">
        <label>开始日期:{{ 开始时间 }}
            <input type="date" value="{{ 开始时间 }}" name="开始时间" class="form-control" required>
        </label>
    </div>
    <div class="form-group">
        <label>结束日期:{{ 结束时间 }}
            <input type="date" value="{{ 结束时间 }}" name="结束时间" class="form-control" required>
        </label>

    </div>
    <br>
    <button type="submit" class="btn btn-primary">提交查询</button>
</form>
<div id="container" style="height: 80%"></div>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
<script type="text/javascript"
        src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
<script src="/static/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
    var 数据 ={{ data|safe }};
    console.log(数据[0]);
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    option = {
        title: {
            text: '发布统计',
            subtext: ' ',
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: 数据[0]
        },
        series: [
            {
                name: '发布次数',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: 数据[1],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    ;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
</script>
</body>
</html>